package gui.components.map.engine;

public class EngineInformation {

	RenderEngine _engine;
	Thread _counter_thread;
	
	private int _totalframes;
	private int _curfps;
	private int _curframes;
	
	private int _rendered_objects;
	private int _rendered_drawcalls;
	private int _curobjects;
	
	public EngineInformation(RenderEngine _eng)
	{
		_engine = _eng;
	}
	
	public void AddFrame()
	{
		_curframes++;
	}
	
	public int GetFPS()
	{
		return _curfps;
	}
	
	public int GetTotalFrames()
	{
		return _totalframes;
	}
	
	public void PerformFPSCount(int _timer_duration)
	{
		_curfps = _curframes / _timer_duration;
		_curframes = 0;
	}
	
	public void StartFPSCounter()
	{
        _counter_thread.start();
	}
	
	public void StopFPSCounter()
	{
        _counter_thread.suspend();
	}
	
	//Start ->  RenderTime
	public void SetRenderTime(int _rendertime_sec)
	{
	}
	//End -> 	RenderTime
	
	//Start ->	Rendered Information
	public void AddRenderedObject()
	{
		_rendered_objects++;
	}
	
	public int GetRenderedObjects()
	{
		return _rendered_objects;
	}
	
	public void AddDrawCall()
	{
		_rendered_drawcalls++;
	}
	
	public int GetDrawCalls()
	{
		return _rendered_drawcalls;
	}
	
	public void AddCurObject()
	{
		_curobjects++;
	}
	
	public int GetCurObjects()
	{
		return _curobjects;
	}
	//End ->	Rendered Information
	
	//Start -> 	Global
	public void ResetInformation(boolean FPS, boolean Rendertime, boolean Objects)
	{
		if(FPS)
		{
			_totalframes = 0;
			_curfps = 0;
			_curframes = 0;
		}
		
		if(Rendertime)
		{
		}
		
		if(Objects)
		{
			_rendered_objects = 0;
			_rendered_drawcalls = 0;
			_curobjects = 0;
		}
	}
	//End ->	Global
}
